From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Eclipse. When I created the site a couple years back I just took > the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? > I don?t have a Mac so I can?t judge whether what we currently have > helps you or not. > ? > I?m actually interested in adding a recent (current) build to the > site. We can build and test Windows and Linux at my company ? if you > could sign up to testing Mac, I?ll be happy to ?Eclipsify? your > builds and upload them to the site. > ? > Ideally, we?d find some Continuous Integration factility (like > Hudson, Jenkins, ?) somewhere public for automated builds of the site > ? do you have an idea? > ? > Cheers > Martin > ? > ? > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > Behalf Of?Greg Johnson > Sent:?Sunday, January 29, 2012 7:24 PM > To:?rxtx at qbang.org > Cc:?Qiangsheng Wang > Subject:?[Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > ? > Dear Martin and others, > ? Is there a maintained set of RXTX eclipse plugins with an update > site? ?We are particularly interested in the 64 bit OSX variant which > appears necessary when using Java 6 on OSX as it does not have a 32 > bit VM at all. > ? > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From greg.johnson at rbr-global.com Mon Jan 30 14:06:41 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 16:06:41 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Is there an address where I can write to the RXTX committers and give them the credentials for the Jenkins instance? Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > This would be great. I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > >> Dear Martin, We run Jenkins and could make an instance publicly available. >> We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we >> could always limit the builds to the quieter periods in any case. >> Cheers, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: >> >> Hi Greg, >> >> The site is >> http://rxtx.qbang.org/eclipse >> and associated downloads are on >> http://rxtx.qbang.org/eclipse/downloads >> >> Interestingly, I updated that site just recently adding p2 metadata >> for Eclipse. When I created the site a couple years back I just took >> the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? >> I don?t have a Mac so I can?t judge whether what we currently have >> helps you or not. >> >> I?m actually interested in adding a recent (current) build to the >> site. We can build and test Windows and Linux at my company ? if you >> could sign up to testing Mac, I?ll be happy to ?Eclipsify? your >> builds and upload them to the site. >> >> Ideally, we?d find some Continuous Integration factility (like >> Hudson, Jenkins, ?) somewhere public for automated builds of the site >> ? do you have an idea? >> >> Cheers >> Martin >> >> >> From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On >> Behalf Of Greg Johnson >> Sent: Sunday, January 29, 2012 7:24 PM >> To: rxtx at qbang.org >> Cc: Qiangsheng Wang >> Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 >> >> Dear Martin and others, >> Is there a maintained set of RXTX eclipse plugins with an update >> site? We are particularly interested in the 64 bit OSX variant which >> appears necessary when using Java 6 on OSX as it does not have a 32 >> bit VM at all. >> >> Many thanks, >> greg >> -- >> Greg Johnson, PhD >> President, RBR Ltd. >> greg.johnson at rbr-global.com >> +1 613 986 1621 (GMT-5, mobile) >> +1 613 233 1621 (GMT-5, office) >> >> <~WRD000.jpg><~WRD000.jpg> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> [OS_Footer.jpg] [Oi_Footer.jpg] > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 12:23:32 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 12:23:32 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle ? > > I don?t have a Mac so I can?t judge whether what we > currently have > > helps you or not. > > ? > > I?m actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company ? if you > > could sign up to testing Mac, I?ll be happy to > ?Eclipsify? your > > builds and upload them to the site. > > ? > > Ideally, we?d find some Continuous Integration > factility (like > > Hudson, Jenkins, ?) somewhere public for automated > builds of the site > > ? do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From Martin.Oberhuber at windriver.com Tue Jan 31 02:03:39 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 31 Jan 2012 09:03:39 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC68455@ALA-MBB.corp.ad.wrs.com> This sounds great ! So here is my rough plan: - Since the existing /rxtx-devel repository is not Eclipse friendly in its layout, I'd like to start a new /rxtx-eclipse repository for the administrative files needed to automatically build site (with .../plugins, /features, /releng siblings as we do these days at Eclipse) - I would initially want to checkin prebuilt binaries into CVS and have just the Java part built by Jenkins / Maven / Tycho, which is state of the art at Eclipse these days - Adding a step which builds binaries locally and replaces checked-out artifacts by the local build should be easy later on. - I'm not yet sure about unittests, I wrote something minimal long ago ... extending this could also be considered once the basic infrastructure is up. Sounds good ? Thanks Martin -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 30, 2012 8:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: Re: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Hi Dr Johnson, We don't have a committers mail-list and many of those with commit access satisfied their personal requirements long ago. I would just start with Martin and I. As committers become active, we (or you) can give them credentials. On Mon, 30 Jan 2012, Greg Johnson wrote: > Is there an address where I can write to the RXTX committers and give them > the credentials for the Jenkins instance? > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 1:18 PM, Trent Jarvi wrote: > > > This would be great. ?I'd offer to help make this work. > > On Mon, 30 Jan 2012, Greg Johnson wrote: > > Dear Martin,? We run Jenkins and could make an > instance publicly available. > > ?We're sitting on a 10Mb fibre, so bandwidth > shouldn't be an issue, and we > > could always limit the builds to the quieter > periods in any case. > > Cheers, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > > ?????Hi Greg, > > ? > > The site is > > ???http://rxtx.qbang.org/eclipse > > and associated downloads are on > > ? ???http://rxtx.qbang.org/eclipse/downloads > > ? > > Interestingly, I updated that site just recently > adding p2 metadata > > for Eclipse. When I created the site a couple years > back I just took > > the rxtx-2.1-7r2 prebuilt binaries and put them > into an OSGi bundle . > > I don't have a Mac so I can't judge whether what we > currently have > > helps you or not. > > ? > > I'm actually interested in adding a recent > (current) build to the > > site. We can build and test Windows and Linux at my > company . if you > > could sign up to testing Mac, I'll be happy to > "Eclipsify" your > > builds and upload them to the site. > > ? > > Ideally, we'd find some Continuous Integration > factility (like > > Hudson, Jenkins, .) somewhere public for automated > builds of the site > > . do you have an idea? > > ? > > Cheers > > Martin > > ? > > ? > > From:?rxtx-bounces at qbang.org?[mailto:rxtx-bounces at qbang.org]?On > > Behalf Of?Greg Johnson > > Sent:?Sunday, January 29, 2012 7:24 PM > > To:?rxtx at qbang.org > > Cc:?Qiangsheng Wang > > Subject:?[Rxtx] Eclipse bundles and update site for > rxtx-2.1-7r2 > > ? > > Dear Martin and others, > > ? Is there a maintained set of RXTX eclipse plugins > with an update > > site? ?We are particularly interested in the 64 bit > OSX variant which > > appears necessary when using Java 6 on OSX as it > does not have a 32 > > bit VM at all. > > ? > > Many thanks, > > greg > > -- > > Greg Johnson, PhD > > President, RBR Ltd. > > greg.johnson at rbr-global.com > > +1 613 986 1621 (GMT-5, mobile) > > +1 613 233 1621 (GMT-5, office) > > ? > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > [OS_Footer.jpg] [Oi_Footer.jpg] > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > [OS_Footer.jpg] [Oi_Footer.jpg] > > > From dispachers at hotmail.com Sun Jan 1 22:16:09 2012 From: dispachers at hotmail.com (Roberto Romo) Date: Sun, 1 Jan 2012 23:16:09 -0600 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: , , , , , Message-ID: Hi Riley After reading a couple of answers i don't really know if I have understood you question correctly but I would say you can solve that with a SerialPortEventListener. You could write a class that implements gnu.io.SerialPortEventListener override the serialEvent method and use a switch case for the data and for the other event. just like: @Override ??? public void serialEvent(SerialPortEvent event) { ??????? switch (event.getEventType()) { ??????????????? case SerialPortEvent.DATA_AVAILABLE: ??????????????????? communicator.datenVerfuegbar(); ??????????????????? break; ??????????????? case SerialPortEvent.BI:?????????????????? ??????????????????? communicator.breakInterrupt(); ??????????????????? break; ??????????????? case SerialPortEvent.CD: ??????????????????? communicator.carrierDetect(); ??????????????????? break; ??????????????? case SerialPortEvent.CTS: ??????????????????? communicator.clearToSend(); ??????????????????? break; ??????????????? case SerialPortEvent.DSR: ??????????????????? communicator.dataSetReady(); ??????????????????? break; ??????????????? case SerialPortEvent.FE: ??????????????????? communicator.framingError(); ??????????????????? break; ??????????????? case SerialPortEvent.OUTPUT_BUFFER_EMPTY: ??????????????????? communicator.outputBufferEmpty(); ??????????????????? break; ??????????????? case SerialPortEvent.PE: ??????????????????? communicator.parityError(); ??????????????????? break; ??????????????? case SerialPortEvent.RI: ??????????????????? communicator.ringIndicator(); ??????????????????? break; ??????????? } ??? } ? I hope this helps, and sorry if I'm complete lost with my answer. Regards Roberto R. ________________________________ > Date: Sat, 31 Dec 2011 22:38:32 -0500 > From: rileyporter at gmail.com > To: rxtx at qbang.org > Subject: Re: [Rxtx] XON / XOFF Question > > Thanks for all the great responses. I am aware of what has been said > so far. However, perhaps I am not very clear in my real question. I > am using a swing worker thread to send the file (line by line) to my > device, which in turns WILL send an XOFF char. How is that character > determined to be in fact sent from the serial device to my program? I > fire serialEvents right now for data available. Should it be handled > something like: > > if(XOFF : serialEventResponseLine){ > slowDown() > }; > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > Thanks again guys, > > Riley > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > wrote: > Good stuff Bob, some followup in line below: > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > the serial port. XON is "enabled" my board will send the XOFF when the > buffer fills to a point. If my java program is for (line : file) { > write(line) } how will "RXTX" know to pause the file sending routine > until XON is received? Perhaps I am missing a major point here :) > > > > Usually this is handled by the same mechanism that holds your program > up if you try to e.g. send 100,000 characters all at once: Your program > is stopped until the data can be absorbed into the internal buffers > between your program and the serial port. > > XON/XOFF is an operating system level control that allows no data to be > lost because of buffer overflows. The handling needs to be as close to > the "mechanical network" as possible, because the OS is the first layer > of buffering which may be affected by flow control. The receiving OS > needs to be able to say STOP if the application is not empty buffers > fast enough, and the sending OS needs to be able to "stop the sending > process" at the moment that more data would overflow the outbound > buffers/hardware registers. > > > You should take this into account in designing your program. For > example, if you try to send lots of data in a single operation from the > Swing thread, your app may appear to be locked up while the XOFF/XON > mechanism is metering the data out. On the other hand, if you only > send little chunks of data, the buffering may handle it completely and > there's no delay. > > For any operation, in Java, which is not related to directly > manipulating some part of the GUI, you need to use some kind of > background threading. The SwingWorker class is a workable solution for > many types of applications. Some people hate it, but the basic > delineation of responsibility between using the EventDispatchThread > anytime you need to update the GUI, and dispatching background threads > anytime a GUI event needs to talk to the "world", are handled. > > I have a more complex version of SwingWorker visible on > http://swing-util.dev.java.net called "SyncThread". It allows you to > dispatch multiple actions, and it includes management of the context > class loader if you need that. > > Gregg Wonderly > > > Bob > > -- > > Bob Jacobsen, LBNL Physics Division > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > AIM, Skype JacobsenRG > > > > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ Rxtx mailing list > Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From rileyporter at gmail.com Mon Jan 2 08:58:48 2012 From: rileyporter at gmail.com (Riley Porter) Date: Mon, 2 Jan 2012 10:58:48 -0500 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: Hello all, Thanks for your replies. @Robert I saw that code snippet and I am using serial event listeners. However I do not think there is such a thing as XON/OFF event. Unless one of the events you listed fires one of those? From what I got back from the list, it seems that the driver for your serial port should handle anything using XON flow control. So if you have a big file to send and the device buffer sits at 2k you can send 2k of that file (and then the device will do something with that data) the serial port should now be buffering the rest of that file into memory. Once the serial device is done processing the sent data (the frist 2k chunk) it sends on the XON and then the serial port driver should send the data that was put into memory to the serial device. Then the whole setup start over again. @Bob thanks for clearing that up. Here is the deal right now. 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. So: 0x10 0x11 = XON 0x10 0x13 = XOFF I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? This is explained in more detail here: Ugly Copy and Paste version: 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the > XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None URL for pdf: http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf On Mon, Jan 2, 2012 at 12:16 AM, Roberto Romo wrote: > > Hi Riley > > After reading a couple of answers i don't really know if I have understood > you question correctly but I > would say you can solve that with a SerialPortEventListener. You could > write a class that implements gnu.io.SerialPortEventListener > > override the serialEvent method and use a switch case for the data and for > the other event. > just like: > > > @Override > public void serialEvent(SerialPortEvent event) { > switch (event.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > communicator.datenVerfuegbar(); > break; > case SerialPortEvent.BI: > communicator.breakInterrupt(); > break; > case SerialPortEvent.CD: > communicator.carrierDetect(); > break; > case SerialPortEvent.CTS: > communicator.clearToSend(); > break; > case SerialPortEvent.DSR: > communicator.dataSetReady(); > break; > case SerialPortEvent.FE: > communicator.framingError(); > break; > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > communicator.outputBufferEmpty(); > break; > case SerialPortEvent.PE: > communicator.parityError(); > break; > case SerialPortEvent.RI: > communicator.ringIndicator(); > break; > } > } > > I hope this helps, and sorry if I'm complete lost with my answer. > > Regards Roberto R. > > ________________________________ > > Date: Sat, 31 Dec 2011 22:38:32 -0500 > > From: rileyporter at gmail.com > > To: rxtx at qbang.org > > Subject: Re: [Rxtx] XON / XOFF Question > > > > Thanks for all the great responses. I am aware of what has been said > > so far. However, perhaps I am not very clear in my real question. I > > am using a swing worker thread to send the file (line by line) to my > > device, which in turns WILL send an XOFF char. How is that character > > determined to be in fact sent from the serial device to my program? I > > fire serialEvents right now for data available. Should it be handled > > something like: > > > > if(XOFF : serialEventResponseLine){ > > slowDown() > > }; > > > > Something like that? Vs perhaps RXTX supplied a XON/XOFF serial event? > > > > Thanks again guys, > > > > Riley > > > > On Sat, Dec 31, 2011 at 9:01 PM, Gregg Wonderly > > > wrote: > > Good stuff Bob, some followup in line below: > > > > On Dec 31, 2011, at 7:02 PM, Bob Jacobsen wrote: > > > > > > > > On Dec 31, 2011, at 2:41 PM, Riley Porter wrote: > > > > > >> Hmm.. So this is my use case.. I am sending a file line by line to > > the serial port. XON is "enabled" my board will send the XOFF when the > > buffer fills to a point. If my java program is for (line : file) { > > write(line) } how will "RXTX" know to pause the file sending routine > > until XON is received? Perhaps I am missing a major point here :) > > > > > > Usually this is handled by the same mechanism that holds your program > > up if you try to e.g. send 100,000 characters all at once: Your program > > is stopped until the data can be absorbed into the internal buffers > > between your program and the serial port. > > > > XON/XOFF is an operating system level control that allows no data to be > > lost because of buffer overflows. The handling needs to be as close to > > the "mechanical network" as possible, because the OS is the first layer > > of buffering which may be affected by flow control. The receiving OS > > needs to be able to say STOP if the application is not empty buffers > > fast enough, and the sending OS needs to be able to "stop the sending > > process" at the moment that more data would overflow the outbound > > buffers/hardware registers. > > > > > You should take this into account in designing your program. For > > example, if you try to send lots of data in a single operation from the > > Swing thread, your app may appear to be locked up while the XOFF/XON > > mechanism is metering the data out. On the other hand, if you only > > send little chunks of data, the buffering may handle it completely and > > there's no delay. > > > > For any operation, in Java, which is not related to directly > > manipulating some part of the GUI, you need to use some kind of > > background threading. The SwingWorker class is a workable solution for > > many types of applications. Some people hate it, but the basic > > delineation of responsibility between using the EventDispatchThread > > anytime you need to update the GUI, and dispatching background threads > > anytime a GUI event needs to talk to the "world", are handled. > > > > I have a more complex version of SwingWorker visible on > > http://swing-util.dev.java.net called "SyncThread". It allows you to > > dispatch multiple actions, and it includes management of the context > > class loader if you need that. > > > > Gregg Wonderly > > > > > Bob > > > -- > > > Bob Jacobsen, LBNL Physics Division > > > Bob_Jacobsen at lbl.gov +1-510-486-7355 > > AIM, Skype JacobsenRG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob_jacobsen at lbl.gov Mon Jan 2 11:31:04 2012 From: bob_jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 2 Jan 2012 11:31:04 -0700 Subject: [Rxtx] XON / XOFF Question In-Reply-To: References: Message-ID: <06D94FE7-3911-45F4-8D74-DA70B85277CD@lbl.gov> No, you're still massively over-thinking this. The device attached to the serial port sends XON and XOFF to do flow control. If it does that properly, XON/XOFF flow control should work. Full stop. All sorts of other things have to happen at other layers to make that work. Don't try to mess with those. Just send the XON/XOFF characters. If you need to send XON or XOFF characters _as_ _data_, not as flow control, there are complicated things you can do to make that work. A much better approach is to just not do it. If you need to send XON or XOFF characters as data, you should not be using XON/XOFF flow control. Bob On Jan 2, 2012, at 8:58 AM, Riley Porter wrote: > @Bob thanks for clearing that up. Here is the deal right now. > > 0x11 and 0x13 are XON/XOFF characters. However it looks like using the FTDI Serial port converter driver, it wants a escape character THEN the XON/XOFF. > > So: > 0x10 0x11 = XON > 0x10 0x13 = XOFF > > I guess they do this to avoid binary collisions that could / would occur when just sending a 0x11 or 0x13 byte. So it would seem that my serial device needs to send a 0x10,0x11 to set xoff. This is a little lame as now I am coding to a driver. If someone else is using a different serial converter chip. Thoughts? > > This is explained in more detail here: > Ugly Copy and Paste version: > > 2.1 Method > This method can use XOn/XOff or hardware RTS/CTS handshaking. Both the XOn/XOff > characters and the escape character are definable. > The standard ones will be: > XOn - 0x11 > XOff - 0x13 > EscChar - 0x10 > Transmitter Receiver > Data In Data Transmitted Data Received Data Out > XOn EscChar + 0x01 EscChar + 0x01 XOn > XOff EscChar + 0x02 EscChar + 0x02 XOff > EscChar EscChar + EscChar EscChar + EscChar EscChar > 0x01 0x01 0x01 0x01 > 0x02 0x02 0x02 0x02 > Flow Control XOn XOn None > Flow Control XOff XOff None > > > URL for pdf: > http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-09_Modem_Emulation_Mode.pdf > -- Bob Jacobsen, LBNL Physics Division Bob_Jacobsen at lbl.gov +1-510-486-7355 AIM, Skype JacobsenRG From rileyporter at gmail.com Fri Jan 6 14:39:38 2012 From: rileyporter at gmail.com (Riley Porter) Date: Fri, 6 Jan 2012 16:39:38 -0500 Subject: [Rxtx] XON recv buffer insertion Message-ID: Hello Again everyone, I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. I hope that makes sense. Riley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gergg at cox.net Fri Jan 6 18:07:51 2012 From: gergg at cox.net (Gregg Wonderly) Date: Fri, 6 Jan 2012 19:07:51 -0600 Subject: [Rxtx] XON recv buffer insertion In-Reply-To: References: Message-ID: <12D5C313-00D7-4869-A72F-5A0E3E80F7AC@cox.net> It's not clear to me, what you are saying. The CNC machine should be able to consume the serial data stream at some rate, and breaking that stream, to insert other data, to me, is confusing. Can you more completely describe what you want to have happen? I am not sure why you need to be able to send a "pause", at random points in time. It would seem to me, that a pause, or other change in movement, would be part of the total movement plan for the machine head/assembly that you are controlling, and thus part of the stream of data that is pending. Gregg Wonderly On Jan 6, 2012, at 3:39 PM, Riley Porter wrote: > Hello Again everyone, > > I have successfully got XON / XOFF working with my project! However, I have another question. I looked around and did not see an answer. Here is the deal. When I start sending data to my device the the device buffer fills and when it gets to x% it sends an XOFF control character. This is working. However, while my Java program is notified that XOFF has been issued (well the driver is), my sendFile routine continues to fill the send buffer with the next commands to be sent once an XON is received. > > My device is a CNC controller btw. So I need to be able to insert "pauses" to the machine that will be sent right away. Is there a way to get access to the send buffer and insert an command (line of data) to the start of the buffer? > > Right now, how it acts is my device sends XOFF and my file sender thread keeps appending to the outbound send buffer. So depending on how big the outbound buffer is when the pause command is sent corresponds to how long it takes to get pause to take effect. > > > I hope that makes sense. > > Riley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From cheersgogo at yahoo.com.tw Fri Jan 13 02:55:40 2012 From: cheersgogo at yahoo.com.tw (謝悟鋒) Date: Fri, 13 Jan 2012 17:55:40 +0800 (CST) Subject: [Rxtx] zekayla1.jackson Message-ID: <1326448540.38769.yint-ygo-j2me@web74204.mail.tp2.yahoo.com> Hi!!! Nice weekend, isn?t it? http://tdy.es/bhrxdfhj.php?weqcampID=42 Fri, 13 Jan 2012 10:55:39 ______________ "It proved to be potatoes; and Raymond told Caleb he might roast them in his fire." (c) HUNTER weissdornen From frans_nieuwerth at nl.ibm.com Fri Jan 13 08:10:10 2012 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Fri, 13 Jan 2012 16:10:10 +0100 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 16-01-2012) Message-ID: I am out of the office until 16-01-2012. I will be out of the office for personal business until the 16th. I do not have access to email. In case of urgency you can try my mobile and/or voicemail. See you next week, Frans Note: This is an automated response to your message "[Rxtx] zekayla1.jackson" sent on 13/1/2012 10:55:40. This is the only notification you will receive while this person is away. From marcin-depczynski at veraxsystems.com Thu Jan 19 02:09:58 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 10:09:58 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function Message-ID: <4F17DDE6.10002@veraxsystems.com> I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial modbus communication on Linux. I have critical problem with java crashes on gnu.io.CommPortIdentifier.native_psmisc_report_owner function. Here is info from memory dump: # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # Problematic frame: # j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # - --------------- T H R E A D --------------- Current thread (0x000000005edb3000): JavaThread "http-9400-4" daemon [_thread_in_native, id=21752, stack(0x00000000440b2000,0x00000000441b3000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00000000000003a0 Registers: RAX=0x000000005dcf2f60, RBX=0x495020746f6f7220, RCX=0x000000005edb3ea8, RDX=0x00002aaaaacf7000 RSP=0x00000000441ac850, RBP=0x00000000441ac8a0, RSI=0x000000005edb3d68, RDI=0x0000000000000330 R8 =0x00002ac1834f9441, R9 =0x0000000000000300, R10=0x00002ac18350d2b0, R11=0x0000000000000ffc R12=0x38313220203d2044, R13=0x72676f7250203838, R14=0x76616a203d206d61, R15=0x000000005edb3000 RIP=0x00002aaaab38006b, EFL=0x0000000000010a17, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Call stack: Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free space=3ea0000000000000018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) j gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 j net.wimpi.modbus.net.SerialConnection.open()V+56 ...here are some calls from my classes... v ~StubRoutines::call_stub V [libjvm.so+0x3e756d] V [libjvm.so+0x5f6f59] V [libjvm.so+0x3e73a5] V [libjvm.so+0x64df01] V [libjvm.so+0x651c72] V [libjvm.so+0x4713fb] C [libjava.so+0x19625] Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x15 Where can I found native_psmisc_report_owner function source code? Could you help me to diagnose what is the source of those errors? Regards Marcin D. From tjarvi at qbang.org Thu Jan 19 01:51:59 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 19 Jan 2012 01:51:59 -0700 (MST) Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F17DDE6.10002@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> Message-ID: On Thu, 19 Jan 2012, Marcin Depczy?ski wrote: > I use jamod library build with rxtx library (2.1-7r2 and 2.2pre2) for serial > modbus communication on Linux. I have critical problem with java crashes on > gnu.io.CommPortIdentifier.native_psmisc_report_owner function. > > Here is info from memory dump: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0x00002aaaab38006b, pid=25542, tid=1158125888 > # > # JRE version: 6.0_21-b06 > # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 > ) > # Problematic frame: > # j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > # > > Call stack: > > Stack: [0x00000000440b2000,0x00000000441b3000], sp=0x00000000441ac850, free > space=3ea0000000000000018k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native > code) > j > gnu.io.CommPortIdentifier.native_psmisc_report_owner(Ljava/lang/String;)Ljava/lang/String;+0 > j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+245 > j net.wimpi.modbus.net.SerialConnection.open()V+56 > ...here are some calls from my classes... > > Where can I found native_psmisc_report_owner function source code? Could you > help me to diagnose what is the source of those errors? > Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } From marcin-depczynski at veraxsystems.com Thu Jan 19 05:42:14 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 13:42:14 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: References: <4F17DDE6.10002@veraxsystems.com> Message-ID: <4F180FA6.50700@veraxsystems.com> W dniu 2012-01-19 09:51, Trent Jarvi pisze: > Hi Marcin, > > The function is in src/psmisc/fuser.c. You will find it towards the > end of the file for Linux. > > JNIEXPORT jstring JNICALL > Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv > *env, > jobject obj, jstring arg) > { > char returnstring[256]; > const char *str = (*env)->GetStringUTFChars(env, arg, 0); > show_user(str,returnstring); > (*env)->ReleaseStringUTFChars(env, arg, str); > return (*env)->NewStringUTF(env, returnstring); > } > Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, |GetStringUTFChars| returns |NULL| and throws an |OutOfMemoryError| exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin-depczynski at veraxsystems.com Thu Jan 19 07:51:22 2012 From: marcin-depczynski at veraxsystems.com (=?UTF-8?B?TWFyY2luIERlcGN6ecWEc2tp?=) Date: Thu, 19 Jan 2012 15:51:22 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function In-Reply-To: <4F180FA6.50700@veraxsystems.com> References: <4F17DDE6.10002@veraxsystems.com> <4F180FA6.50700@veraxsystems.com> Message-ID: <4F182DEA.1070703@veraxsystems.com> I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: > > W dniu 2012-01-19 09:51, Trent Jarvi pisze: >> Hi Marcin, >> >> The function is in src/psmisc/fuser.c. You will find it towards the >> end of the file for Linux. >> >> JNIEXPORT jstring JNICALL >> Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv >> *env, >> jobject obj, jstring arg) >> { >> char returnstring[256]; >> const char *str = (*env)->GetStringUTFChars(env, arg, 0); >> show_user(str,returnstring); >> (*env)->ReleaseStringUTFChars(env, arg, str); >> return (*env)->NewStringUTF(env, returnstring); >> } >> > > Hi Trent, > > Thanks for fast replay. > I'm not proficient in JNI programming, but I found following guide > http://java.sun.com/docs/books/jni/html/jniTOC.html > > In section 3.2.1 entitled "Converting to native string" states, that > there is a chance that memory allocation for GetStringUTFChars will > fail. When that happens, |GetStringUTFChars| returns |NULL| and throws > an |OutOfMemoryError| exception. In given example, there is a checking > for NULL value: > JNIEXPORT jstring JNICALL > Java_|Prompt|_getLine(JNIEnv *env, jobject obj, jstring prompt) > { > char buf[128]; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, prompt, NULL); > if (str == NULL) { > return NULL; /* OutOfMemoryError already thrown */ > } > printf("%s", str); > (*env)->ReleaseStringUTFChars(env, prompt, str); > /* We assume here that the user does not type more than > * 127 characters */ > scanf("%s", buf); > return (*env)->NewStringUTF(env, buf); > } > > Perhaps such a NULL-check should be in your method? > > Regards Marcin D. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Thu Jan 19 08:23:48 2012 From: mariusz.dec at gmail.com (M.Dec-GM) Date: Thu, 19 Jan 2012 16:23:48 +0100 Subject: [Rxtx] JVM crashes on native_psmisc_report_owner function References: <4F17DDE6.10002@veraxsystems.com><4F180FA6.50700@veraxsystems.com> <4F182DEA.1070703@veraxsystems.com> Message-ID: <85EAF099EED74D7688581B084902726E@mdam3> HI, I have written here many times about my experiences with close() on all platforms (W/M/L) in 32 bit systems. Common working method was setting ReceiveTimeot as more than zero. This setting was not needed in W, sometimes needed in M, always needed in L. It doesn't disturb in W. Try it. Mybe works in 64 as well. Powodzenia :) Regards Mariusz ----- Original Message ----- From: Marcin Depczy?ski To: rxtx at qbang.org Sent: Thursday, January 19, 2012 3:51 PM Subject: Re: [Rxtx] JVM crashes on native_psmisc_report_owner function I have 2 more questions. Could you explain to me, what are are the differences between throwing an PortInUseException in CommPortIdentifier.open method, once with a "getCurrentOwner()" parameter and second time with a "native_psmisc_report_owner(PortName)" parameter? Is it necessary to use native_psmisc_report_owner(PortName) function at this place? May I replace native_psmisc_report_owner(PortName) function call with something else or give up entirely of that? The second question concerns the problem of closing the port. My serial port is repeatedly opened and closed for reading. Sometimes serial port lock isn't unlocked and port stays locked for further reading. It helps to manualy remove the lock file from the system. Why the lock isn't properly unlocked after calling SerialPort.close() method? W dniu 2012-01-19 13:42, Marcin Depczy?ski pisze: W dniu 2012-01-19 09:51, Trent Jarvi pisze: Hi Marcin, The function is in src/psmisc/fuser.c. You will find it towards the end of the file for Linux. JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner (JNIEnv *env, jobject obj, jstring arg) { char returnstring[256]; const char *str = (*env)->GetStringUTFChars(env, arg, 0); show_user(str,returnstring); (*env)->ReleaseStringUTFChars(env, arg, str); return (*env)->NewStringUTF(env, returnstring); } Hi Trent, Thanks for fast replay. I'm not proficient in JNI programming, but I found following guide http://java.sun.com/docs/books/jni/html/jniTOC.html In section 3.2.1 entitled "Converting to native string" states, that there is a chance that memory allocation for GetStringUTFChars will fail. When that happens, GetStringUTFChars returns NULL and throws an OutOfMemoryError exception. In given example, there is a checking for NULL value: JNIEXPORT jstring JNICALL Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt) { char buf[128]; const jbyte *str; str = (*env)->GetStringUTFChars(env, prompt, NULL); if (str == NULL) { return NULL; /* OutOfMemoryError already thrown */ } printf("%s", str); (*env)->ReleaseStringUTFChars(env, prompt, str); /* We assume here that the user does not type more than * 127 characters */ scanf("%s", buf); return (*env)->NewStringUTF(env, buf); } Perhaps such a NULL-check should be in your method? Regards Marcin D. _______________________________________________ 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 Kustaa.Nyholm at planmeca.com Thu Jan 19 08:28:12 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 Jan 2012 17:28:12 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Message-ID: Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti From ddevecchio at celestron.com Thu Jan 19 10:49:37 2012 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Thu, 19 Jan 2012 09:49:37 -0800 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C70515A7557C@nubula-vm2> My own philosophy of port ownership is that I try to release the port (close it) whenever I am not using it. If I set up a background task to use the com port, then part of writing the routine is to make sure it is closed on exit. If the routine exits by exception, then the exception handler takes care of it. As such, I never use CommPortOwnershipListener. If I am in possession of the port, I am using it and I am certainly not going to release it in the middle a data exchange so that some unknown party just because they asked nicely. I could think of uses where you had a routine that acted as a "default listener that never exited" but which would turn over control to something else on the same JVM that wanted to _initiate_ new communications. But as Krustaa pointed out, I could build that behavior into the listener as easily as trying to build it into a comm port. This brings up something else that I have run into recently. Sometimes the call to close (windows XP.32 but maybe others as well) will return almost immediately. Other times it will take up to 2 seconds to return. There was a time I did that in Done() of a SwingWorker but doesn't Done execute on the EDT? Whatever thread it runs on, 2 seconds is a long time. > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kustaa Nyholm > Sent: Thursday, January 19, 2012 7:28 AM > To: rxtx at qbang.org > Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using > it? > > Marcin's recent postings brought back an old issue/question I have: > > What is the use of CommPortOwnershipListener? > > Cursory look inside RXTXT source code suggests that it only > works within the single JVM instance, which seems to make it > pretty useless or at least unnecessary as surely if anyone > needs it they could wrap their own just as easily. > > I had a cursory look at the JavaComm javadoc and did not > found any definitive answer if it should work across JVMs or not. > I seem to remember that previously I had inferred from the javadoc > that it works by definition only within a single application. > > Nor could I found out if JavaComm CommPortOwnershipListener > actually works or not accross JVMs. > > Also it seem pretty much ambitious to make this work between > Java and native applications not to mention between different > users/sessions in a shared box. > > So is anyone actually using this and if so why? > > Does JavaComm work any 'better' than RXTX in this respect? > > I'm mainly interested in this as my PureJavaComm works the > same way as RXTX and I was sort of wondering if I should > try to improve this aspect for more conformance to JavaComm or not... > > To make it work across different JVM instances and user sessions > I guess something based on sockets/local loopback could be > hacked together but this would probably have its own issues > such as port conflicts etc. > > Seems like a lot of work and potential failure points for > a pretty useless feature if you ask me...or maybe I'm not > seeing this clearly... > > > cheers Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From msemtd at googlemail.com Thu Jan 19 15:46:45 2012 From: msemtd at googlemail.com (Michael Erskine) Date: Thu, 19 Jan 2012 22:46:45 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: The comm port ownership part of javacomm has always only been for a single jvm at least in the Sun reference implementation on Solaris, Windows and perhaps others. I don't know of any real use for it unless your application is to grab all ports and act as a service provider for example as a fax server. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 23 02:39:06 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 23 Jan 2012 09:39:06 +0000 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Hi Kustaa, At Eclipse, we're running inside a single VM but multiple plugins (which may not know anything about each other) can be installed by the end user. In this situation, it is possible the different plugins may want access to the serial port, and we're using the CommPortOwnershipListener in order to cleanly give up access if some other plugin wants it. For example, in our commercial offering on top of Eclipse, a serial terminal can own the port most of the time; but we also have a wizard (in a different plugin) which can automatically retrieve settings from an embedded target, and a higher connection layer (yet another plugin) which can exchange data over the serial line. In the past, when a port was owned by eg the Terminal and another plugin wanted access, we allowed the user to grant or disallow the request; but that never worked well since multiple dialogs were stacked on top of each other. Our new workflow is that a plugin which wants access to a port that's currently owned by a different plugin asks the user whether it's OK to steal the port; any currently owning plugin releases the port without further notice. More rationale for this workflow decision is documented on Eclipse Bugzilla 221184 [1]. So in my opinion, the only use of CommPortOwnershipListener is clean shutdown of a port-owning system when the port is requested ("stolen") by somebody else. For reference, the code of our Eclipse Terminal is available in Open Source here [2] at line 71 ff, and here [3] at line 146 ff (polite question whether the port should be stolen) and line 163 ff (actually stealing the port). Now, regarding your concrete questions ... 1. Yes there is some sense using CommPortOwnershipListener inside a single VM and we use it 2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a couple of bugs in RXTX several years back) 3. Trying to make it work across VM's doesn't make sense just like stealing a port from a native app doesn't make sense... the best you can do is a dialog showing / identifying the app that currently holds the port, such that the user can manually close that other app; note that in this case, the user can switch to the other app for closing it, which may not always possible if there's multiple clients / plugins inside a single componentized system like Eclipse, Netbeans or similar 4. One potential problem that a componentized system may have is if one component uses JavaComm and the other is using RXTX ... then these two can't talk to each other. IMO another reason why trying to allow your PureJavaComm work across multiple VM's doesn't make sense IMO. Cheers, Martin [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 [2] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialPortHandler.java?view=markup&root=Tools_Project [3] http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/SerialConnectWorker.java?view=markup&root=Tools_Project -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kustaa Nyholm Sent: Thursday, January 19, 2012 4:28 PM To: rxtx at qbang.org Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? Marcin's recent postings brought back an old issue/question I have: What is the use of CommPortOwnershipListener? Cursory look inside RXTXT source code suggests that it only works within the single JVM instance, which seems to make it pretty useless or at least unnecessary as surely if anyone needs it they could wrap their own just as easily. I had a cursory look at the JavaComm javadoc and did not found any definitive answer if it should work across JVMs or not. I seem to remember that previously I had inferred from the javadoc that it works by definition only within a single application. Nor could I found out if JavaComm CommPortOwnershipListener actually works or not accross JVMs. Also it seem pretty much ambitious to make this work between Java and native applications not to mention between different users/sessions in a shared box. So is anyone actually using this and if so why? Does JavaComm work any 'better' than RXTX in this respect? I'm mainly interested in this as my PureJavaComm works the same way as RXTX and I was sort of wondering if I should try to improve this aspect for more conformance to JavaComm or not... To make it work across different JVM instances and user sessions I guess something based on sockets/local loopback could be hacked together but this would probably have its own issues such as port conflicts etc. Seems like a lot of work and potential failure points for a pretty useless feature if you ask me...or maybe I'm not seeing this clearly... cheers Kusti _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Mon Jan 23 10:13:38 2012 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 23 Jan 2012 19:13:38 +0200 Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using it? In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FBFF17C@ALA-MBB.corp.ad.wrs.com> Message-ID: On 1/23/12 11:39, "Oberhuber, Martin" wrote: Hi Martin, thanks for a very informative answer. So my conclusion is that in this respect JavaComm,RXTX and PureJavaComm all perform the same and there is no need to try to 'improve' this. Good, let's keep it that the way it is. cheers Kusti >Hi Kustaa, > >At Eclipse, we're running inside a single VM but multiple plugins (which >may not know anything about each other) can be installed by the end user. >In this situation, it is possible the different plugins may want access >to the serial port, and we're using the CommPortOwnershipListener in >order to cleanly give up access if some other plugin wants it. > >For example, in our commercial offering on top of Eclipse, a serial >terminal can own the port most of the time; but we also have a wizard (in >a different plugin) which can automatically retrieve settings from an >embedded target, and a higher connection layer (yet another plugin) which >can exchange data over the serial line. > >In the past, when a port was owned by eg the Terminal and another plugin >wanted access, we allowed the user to grant or disallow the request; but >that never worked well since multiple dialogs were stacked on top of each >other. Our new workflow is that a plugin which wants access to a port >that's currently owned by a different plugin asks the user whether it's >OK to steal the port; any currently owning plugin releases the port >without further notice. More rationale for this workflow decision is >documented on Eclipse Bugzilla 221184 [1]. > >So in my opinion, the only use of CommPortOwnershipListener is clean >shutdown of a port-owning system when the port is requested ("stolen") by >somebody else. For reference, the code of our Eclipse Terminal is >available in Open Source here [2] at line 71 ff, and here [3] at line 146 >ff (polite question whether the port should be stolen) and line 163 ff >(actually stealing the port). > >Now, regarding your concrete questions ... > >1. Yes there is some sense using CommPortOwnershipListener inside a >single VM and we use it > >2. Sun JavaCom works exactly the same as RXTX (after I actually fixed a >couple of bugs in RXTX several years back) > >3. Trying to make it work across VM's doesn't make sense just like >stealing a port from a native app doesn't make sense... the best you can >do is a dialog showing / identifying the app that currently holds the >port, such that the user can manually close that other app; note that in >this case, the user can switch to the other app for closing it, which may >not always possible if there's multiple clients / plugins inside a single >componentized system like Eclipse, Netbeans or similar > >4. One potential problem that a componentized system may have is if one >component uses JavaComm and the other is using RXTX ... then these two >can't talk to each other. IMO another reason why trying to allow your >PureJavaComm work across multiple VM's doesn't make sense IMO. > >Cheers, >Martin > >[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=221184 > >[2] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialPortHandler.java?view=markup&root=Tools_Project > >[3] >http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.tm.core/terminal/org >.eclipse.tm.terminal.serial/src/org/eclipse/tm/internal/terminal/serial/Se >rialConnectWorker.java?view=markup&root=Tools_Project > > >-----Original Message----- >From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of >Kustaa Nyholm >Sent: Thursday, January 19, 2012 4:28 PM >To: rxtx at qbang.org >Subject: [Rxtx] CommPortOwnershipListener in JavaComm / RXTX anyone using >it? > >Marcin's recent postings brought back an old issue/question I have: > >What is the use of CommPortOwnershipListener? > >Cursory look inside RXTXT source code suggests that it only works within >the single JVM instance, which seems to make it pretty useless or at >least unnecessary as surely if anyone needs it they could wrap their own >just as easily. > >I had a cursory look at the JavaComm javadoc and did not found any >definitive answer if it should work across JVMs or not. >I seem to remember that previously I had inferred from the javadoc that >it works by definition only within a single application. > >Nor could I found out if JavaComm CommPortOwnershipListener actually >works or not accross JVMs. > >Also it seem pretty much ambitious to make this work between Java and >native applications not to mention between different users/sessions in a >shared box. > >So is anyone actually using this and if so why? > >Does JavaComm work any 'better' than RXTX in this respect? > >I'm mainly interested in this as my PureJavaComm works the same way as >RXTX and I was sort of wondering if I should try to improve this aspect >for more conformance to JavaComm or not... > >To make it work across different JVM instances and user sessions I guess >something based on sockets/local loopback could be hacked together but >this would probably have its own issues such as port conflicts etc. > >Seems like a lot of work and potential failure points for a pretty >useless feature if you ask me...or maybe I'm not seeing this clearly... > > >cheers Kusti > > > >_______________________________________________ >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 > -- Kustaa Nyholm Research Manager, Software Research and Technology Division PLANMECA OY Asentajankatu 6 00880 HELSINKI FINLAND Please note our new telephone and fax numbers! Tel: +358 20 7795 572 (direct) Fax: +358 20 7795 676 GSM: +358 40 580 5193 e-mail: kustaa.nyholm at planmeca.com From greg.johnson at rbr-global.com Sun Jan 29 11:23:36 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Sun, 29 Jan 2012 13:23:36 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Oberhuber at windriver.com Mon Jan 30 05:58:04 2012 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 30 Jan 2012 12:58:04 +0000 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: References: Message-ID: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Hi Greg, The site is http://rxtx.qbang.org/eclipse and associated downloads are on http://rxtx.qbang.org/eclipse/downloads Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ... I don't have a Mac so I can't judge whether what we currently have helps you or not. I'm actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ... if you could sign up to testing Mac, I'll be happy to "Eclipsify" your builds and upload them to the site. Ideally, we'd find some Continuous Integration factility (like Hudson, Jenkins, ...) somewhere public for automated builds of the site ... do you have an idea? Cheers Martin From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson Sent: Sunday, January 29, 2012 7:24 PM To: rxtx at qbang.org Cc: Qiangsheng Wang Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Dear Martin and others, Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. Many thanks, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) [Description: Image removed by sender.][Description: Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: From greg.johnson at rbr-global.com Mon Jan 30 06:22:28 2012 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Mon, 30 Jan 2012 08:22:28 -0500 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> Message-ID: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Dear Martin, We run Jenkins and could make an instance publicly available. We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we could always limit the builds to the quieter periods in any case. Cheers, greg -- Greg Johnson, PhD President, RBR Ltd. greg.johnson at rbr-global.com +1 613 986 1621 (GMT-5, mobile) +1 613 233 1621 (GMT-5, office) On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > Hi Greg, > > The site is > http://rxtx.qbang.org/eclipse > and associated downloads are on > http://rxtx.qbang.org/eclipse/downloads > > Interestingly, I updated that site just recently adding p2 metadata for Eclipse. When I created the site a couple years back I just took the rxtx-2.1-7r2 prebuilt binaries and put them into an OSGi bundle ? I don?t have a Mac so I can?t judge whether what we currently have helps you or not. > > I?m actually interested in adding a recent (current) build to the site. We can build and test Windows and Linux at my company ? if you could sign up to testing Mac, I?ll be happy to ?Eclipsify? your builds and upload them to the site. > > Ideally, we?d find some Continuous Integration factility (like Hudson, Jenkins, ?) somewhere public for automated builds of the site ? do you have an idea? > > Cheers > Martin > > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Greg Johnson > Sent: Sunday, January 29, 2012 7:24 PM > To: rxtx at qbang.org > Cc: Qiangsheng Wang > Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 > > Dear Martin and others, > Is there a maintained set of RXTX eclipse plugins with an update site? We are particularly interested in the 64 bit OSX variant which appears necessary when using Java 6 on OSX as it does not have a 32 bit VM at all. > > Many thanks, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > <~WRD000.jpg><~WRD000.jpg> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx See us at: Ocean Sciences SaltLake City February 20-24 Oceanology International London March 13-15 International Polar Year Montr?al April 22-27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Mon Jan 30 11:18:25 2012 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 Jan 2012 11:18:25 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> References: <146B1557584B0B4DBD25ABAD45EF70F01FC5FD82@ALA-MBB.corp.ad.wrs.com> <1FA20E32-47C0-40A0-AED3-6572654C6EB3@rbr-global.com> Message-ID: This would be great. I'd offer to help make this work. On Mon, 30 Jan 2012, Greg Johnson wrote: > Dear Martin,? We run Jenkins and could make an instance publicly available. > ?We're sitting on a 10Mb fibre, so bandwidth shouldn't be an issue, and we > could always limit the builds to the quieter periods in any case. > > Cheers, > greg > -- > Greg Johnson, PhD > President, RBR Ltd. > greg.johnson at rbr-global.com > +1 613 986 1621 (GMT-5, mobile) > +1 613 233 1621 (GMT-5, office) > > On 2012-01-30, at 7:58 AM, Oberhuber, Martin wrote: > > Hi Greg, > ? > The site is > ???http://rxtx.qbang.org/eclipse > and associated downloads are on > ? ???http://rxtx.qbang.org/eclipse/downloads > ? > Interestingly, I updated that site just recently adding p2 metadata > for Ecl